﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TJADRICD.DLL;

namespace TJADRICD.CollaborativeDesignPlugin.Commission
{
    class Competence
    {
        CompetenceStr cStr = new CompetenceStr();
    }

    class CompetenceStr
    {
        static const CONST.ConstCompetence strSize = CONST.ConstCompetence.WEAK_ELECTRIC_COUNTERSIGN3 + 1;
        char[] competenceDistinguishStr = new char[Convert.ToInt32(strSize)];
        void SetCompetenceStr(string strValue)
        {
            if (strValue.Length != Convert.ToInt32(strSize)) return;
            competenceDistinguishStr = strValue.ToCharArray();
        }
        string toString()
        {
            return new string(competenceDistinguishStr);
        }
        bool CompetenceDistinguish(string currentCompetence, CONST.ConstCompetence targetSign)
        {
            
            if (currentCompetence.Length != Convert.ToInt32(strSize)) return false;
            char[] currentCompetenceStr = currentCompetence.ToCharArray();
            return Convert.ToBoolean(Convert.ToInt32(competenceDistinguishStr[Convert.ToInt32(targetSign)]) * Convert.ToInt32(currentCompetenceStr[Convert.ToInt32(targetSign)]));
        }
    }
}
